package com.cangxuan.manage.service.impl;

import com.cangxuan.manage.bean.Page;
import com.cangxuan.manage.dao.IOrderDao;
import com.cangxuan.manage.dao.IUserAmountRecordDao;
import com.cangxuan.manage.entity.Order;
import com.cangxuan.manage.entity.Registration;
import com.cangxuan.manage.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.awt.image.ImageObserver;
import java.util.List;

/**
 *
 *作者：游星宇
 */
@Service
public class IOrderServiceImpl implements IOrderService {
    IOrderDao iOrderDao;
    @Autowired
    public void setiOrderDao(IOrderDao iOrderDao) {
        this.iOrderDao = iOrderDao;
    }

 /*   @Override
    public List<Order> select1(String name,String  orderformStateName,Integer buyerId) {

        return iOrderDao.select1(name,orderformStateName,buyerId);
    }*/

    @Override
    public Page<Order> page1(int pageIndex, int pageSize, String name, String orderformStateName, Integer buyerId) {
        Page<Order>  orderPage=new Page<>(pageIndex,pageSize);
        orderPage.setRecords(iOrderDao.selectaFy1(pageIndex, pageSize,name,orderformStateName,buyerId));
        orderPage.setTotal(iOrderDao.selectCount1(name,orderformStateName,buyerId));
        return orderPage;
    }

 /*   @Override
    public List<Order> select2(String name, String orderformStateName, Integer sellerId, Integer buyerId) {
        return iOrderDao.select2(name,orderformStateName,sellerId,buyerId);
    }*/

    @Override
    public Page<Order> page2(int pageIndex, int pageSize, String name, String orderformStateName, Integer sellerId, Integer buyerId) {
        Page<Order>  orderPage2=new Page<>(pageIndex,pageSize);
        orderPage2.setRecords(iOrderDao.selectaFy2(pageIndex, pageSize,name,orderformStateName,sellerId,buyerId));
        orderPage2.setTotal(iOrderDao.selectCount2(name,orderformStateName,sellerId,buyerId));
        return orderPage2;
    }
}
